using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace AbstractFactoryPattern
{
    class DataAccess
    {
        private static readonly string AssemblyName = "AbstractFactoryPattern";
        private static readonly string DBString = "Access";//SqlServer
        
        public static IUser CreateUser()
        {
            string className = AssemblyName + "." + DBString + "User";
            return (IUser)Assembly.Load(AssemblyName).CreateInstance(className);
        }

        public static IDepartment CreateDepartment()
        {
            string className = AssemblyName + "." + DBString + "Department";
            return (IDepartment)Assembly.Load(AssemblyName).CreateInstance(className);
        }
    }
}
